package br.ufmg.dcc.simulesspl;

import br.ufmg.dcc.simulesspl.di.GuiceInjector;
import br.ufmg.dcc.simulesspl.fsm.FSM;
import br.ufmg.dcc.simulesspl.model.GameBoard;
import br.ufmg.dcc.simulesspl.states.CodingState;
import br.ufmg.dcc.simulesspl.states.EndState;
import br.ufmg.dcc.simulesspl.states.EngineerSelectionState;
import br.ufmg.dcc.simulesspl.states.ProjectSelectionState;
import br.ufmg.dcc.simulesspl.states.SprintStartState;

public class Game {
	
	public static void main(String[] args) {
		GameBoard gameBoard = GuiceInjector.get().getInstance(GameBoard.class);
		
		ProjectSelectionState projectSelectionState = new ProjectSelectionState();
		SprintStartState sprintStartState = new SprintStartState();
		EngineerSelectionState engineerSelectionState = new EngineerSelectionState();
		CodingState codingState = new CodingState();
		EndState endState = new EndState();
		
		FSM fsm = new FSM();
		
		fsm.goToAndRun(projectSelectionState);
		while(!gameBoard.isOver()) {
			fsm.goToAndRun(sprintStartState);
			fsm.goToAndRun(engineerSelectionState);
			fsm.goToAndRun(codingState);
		}
		fsm.goToAndRun(endState);
		fsm.finish();
	}
}
